//@author A0105543N
#include "BudgetItem.h"

int BudgetItem::getNecessity()
{
	return Necessity;
}

bool BudgetItem::recordExtra() // Record data provided by user.
{
	cout << "Category:  (Press Enter key to exit.)\n";
	getline(cin,category);
	if (category == "" || category == "\n") getline(cin,category);
	if (category == "\n") return false;
	cout << "Necessity(an integer, the larger, the more necessary. Press -1 to exit.):\n";
	cin >> Necessity;
	if (Necessity == -1) return false; 
	return true;
}

void BudgetItem::writefile(char* filename) // BudgetItem does not need to be stored for future use.
{
}
	
void BudgetItem::record_from_file(ifstream& infile, streampos address) // No record in external file.
{
}

bool BudgetItem::isexpense()
{
	return true;
}

void BudgetItem::print() 
{
	cout << fixed << setprecision(2);
	cout << name << " for " << price << endl;
}

bool BudgetItem::compare(Item&)
{
	return true;
}